Re: [PHP] Should I go with the Singleton Pattern or wait for 5.3?

2008-07-14 Thread Luigi Perroti
On Tue, Jul 15, 2008 at 2:10 AM, Chris wrote: > > Is this a decision for the whole project or just one particular part of > it? Can that one part be put off until later or does it need to be done > first? > This decision will impact the whole project. I think that maybe I should go with the Singl

RE: [PHP] mkdir permission errors

2008-07-14 Thread Robert Cummings
On Mon, 2008-07-14 at 22:09 -0400, Wei, Alice J. wrote: > > This is the output I have got from using your script. > > I have made a following quick change: > > > > [EMAIL PROTECTED] var]# chown -R root:root . > > > > Not surprisingly, I am still not able to make a new directory using PHP > > with

RE: [PHP] mkdir permission errors

2008-07-14 Thread Wei, Alice J.
> This is the output I have got from using your script. > I have made a following quick change: > > [EMAIL PROTECTED] var]# chown -R root:root . > > Not surprisingly, I am still not able to make a new directory using PHP with > the HTTP. > Could there be anything else I missed? I knew who you wer

RE: [PHP] mkdir permission errors

2008-07-14 Thread Robert Cummings
On Mon, 2008-07-14 at 16:45 -0400, Wei, Alice J. wrote: > Hi, Wolf: > > Like I guessed, I am still defined as the root user. > > [EMAIL PROTECTED] html]# php test.php > root > root/var/www/html > /var/www/html > > This is the output I have got from using your script. > I have made a following

Re: [PHP] Should I go with the Singleton Pattern or wait for 5.3?

2008-07-14 Thread Chris
Luigi Perroti wrote: > Hello, I'm planning out a simple project and most probably I will need > the functionality provided by the Singleton pattern. > However with the next 5.3 release I would be able to conveniently use > classes directly without instancing them. > This would be a comparable optio

Re: [PHP] Math Weirdness - Can it be done with integers alone??

2008-07-14 Thread tedd
At 4:45 PM -0400 7/14/08, Daniel Brown wrote: That's as far OT as I'm going, but it's worth noting how regulation doesn't do shit if it's not enforced. The only thing that's regulated AND enforced is what you owe the government. Don't get me started. :-) Cheers, tedd -- --- http://

RE: [PHP] Math Weirdness - Can it be done with integers alone??

2008-07-14 Thread tedd
At 4:15 PM -0400 7/14/08, Robert Cummings wrote: Nope, banks can't round like that when calculating your daily interest :) Cheers, Rob. I do know that when it comes to interest you pay them, they round up. When it comes to interest they pay you, they round down -- and why not? A decision h

RE: [PHP] mkdir permission errors

2008-07-14 Thread Wolf
Alice: Bottom post like everyone else... "Wei wrote: > Hi, Wolf: > > Like I guessed, I am still defined as the root user. > > [EMAIL PROTECTED] html]# php test.php > root > root/var/www/html > /var/www/html > > This is the output I have got from using your script. > I have made a follow

Re: [PHP] mkdir permission errors

2008-07-14 Thread Daniel Brown
On Mon, Jul 14, 2008 at 4:45 PM, Wei, Alice J. <[EMAIL PROTECTED]> wrote: > > [EMAIL PROTECTED] html]# php test.php > root > root/var/www/html > /var/www/html Stop testing from the CLI when you need to see results for HTTP then. -- Dedicated Servers - Intel 2.4GHz w/2TB bandwidth/mo. starti

Re: [PHP] mkdir permission errors

2008-07-14 Thread Daniel Brown
On Mon, Jul 14, 2008 at 4:37 PM, Wolf <[EMAIL PROTECTED]> wrote: > > $whoami=system('whoami'); > echo $whoami; > > $pwd=system('pwd'); > echo $pwd; > > That should tell you what ID you are and the path you are in. Conversely, so will this method: -- Dedicated Servers - Intel 2.4GHz w/2TB

RE: [PHP] mkdir permission errors

2008-07-14 Thread Wei, Alice J.
Hi, Wolf: Like I guessed, I am still defined as the root user. [EMAIL PROTECTED] html]# php test.php root root/var/www/html /var/www/html This is the output I have got from using your script. I have made a following quick change: [EMAIL PROTECTED] var]# chown -R root:root . Not surprisingly,

RE: [PHP] Math Weirdness

2008-07-14 Thread Jay Blanchard
[snip] Yeah, I prefer to work with pennies too when doing that stuff. But floats work much better when skimming... harder to track ;) Remind me not to buy weed from Jay. [/snip] Hehehehehehe ;) -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] Math Weirdness - Can it be done with integers alone??

2008-07-14 Thread Daniel Brown
On Mon, Jul 14, 2008 at 4:28 PM, Robert Cummings <[EMAIL PROTECTED]> wrote: > > I'm not completely sure about the U.S. but banks in Canada are > regulated... fortunately :) They are here, too, to a certain extent. The problem is, they can create their own rules that cost the customer a fortun

RE: [PHP] Math Weirdness - Can it be done with integers alone??

2008-07-14 Thread Alex Chamberlain
> On Mon, 2008-07-14 at 16:25 -0400, Daniel Brown wrote: > > On Mon, Jul 14, 2008 at 4:15 PM, Robert Cummings > <[EMAIL PROTECTED]> wrote: > > > > > > Nope, banks can't round like that when calculating your daily > > > interest :) > > > > If it works in their favor, you'd be surprised what they

RE: [PHP] Math Weirdness

2008-07-14 Thread Jay Blanchard
[snip] So does that mean your problem is solved? [/snip] It would appear so. I just need to remember to check for absolute values when working with floats. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

RE: [PHP] mkdir permission errors

2008-07-14 Thread Wolf
"Wei wrote: > Hi, Rob: > > I forgot to mention that I have been using yum install. > I have reinstalled the entire thing, put back all the packages, and then I > went to /var and did a chmod -R 777 var, and then did a > >[EMAIL PROTECTED] var]# chown -R apache:apache . > > Interes

RE: [PHP] mkdir permission errors

2008-07-14 Thread Wei, Alice J.
Hi, Rob: I forgot to mention that I have been using yum install. I have reinstalled the entire thing, put back all the packages, and then I went to /var and did a chmod -R 777 var, and then did a [EMAIL PROTECTED] var]# chown -R apache:apache . Interestingly, I do not see anything differ

Re: [PHP] Math Weirdness - Can it be done with integers alone??

2008-07-14 Thread Robert Cummings
On Mon, 2008-07-14 at 16:25 -0400, Daniel Brown wrote: > On Mon, Jul 14, 2008 at 4:15 PM, Robert Cummings <[EMAIL PROTECTED]> wrote: > > > > Nope, banks can't round like that when calculating your daily > > interest :) > > If it works in their favor, you'd be surprised what they do. > That's w

Re: [PHP] Math Weirdness - Can it be done with integers alone??

2008-07-14 Thread Daniel Brown
On Mon, Jul 14, 2008 at 4:15 PM, Robert Cummings <[EMAIL PROTECTED]> wrote: > > Nope, banks can't round like that when calculating your daily > interest :) If it works in their favor, you'd be surprised what they do. That's why extending TILA to banks in the US is such a big deal to me, yet ge

RE: [PHP] Math Weirdness - Can it be done with integers alone??

2008-07-14 Thread Robert Cummings
On Mon, 2008-07-14 at 21:09 +0100, Alex Chamberlain wrote: > [quote] > I don't quite understand your problem, but I use integers for any monetary > workings as you can guarantee it is accurate (obviously, you work in pence > or cents rather than GBP or USD). > > > > Alex > > > Hello Alex, >

Re: [PHP] Math Weirdness

2008-07-14 Thread Robert Cummings
On Mon, 2008-07-14 at 15:00 -0500, Daniel Kolbo wrote: > > > > I don't quite understand your problem, but I use integers for any monetary > > workings as you can guarantee it is accurate (obviously, you work in pence > > or cents rather than GBP or USD). > > > > > > > > Alex > > > > Hello Ale

RE: [PHP] Math Weirdness - Can it be done with integers alone??

2008-07-14 Thread Alex Chamberlain
[quote] I don't quite understand your problem, but I use integers for any monetary workings as you can guarantee it is accurate (obviously, you work in pence or cents rather than GBP or USD). Alex Hello Alex, I was reading through this thread, and I was curious about what methods you use t

Re: [PHP] Math Weirdness

2008-07-14 Thread Daniel Brown
On Mon, Jul 14, 2008 at 4:00 PM, Alex Chamberlain <[EMAIL PROTECTED]> wrote: > > Surely, for difference, > $totChargeDiff = abs($endingBal - $totalCharges); Yes, in live code. I gave my example to illustrate my point, not to be used in code. I believe Jay would understand that. -- Dedica

Re: [PHP] Math Weirdness

2008-07-14 Thread Daniel Kolbo
I don't quite understand your problem, but I use integers for any monetary workings as you can guarantee it is accurate (obviously, you work in pence or cents rather than GBP or USD). Alex Hello Alex, I was reading through this thread, and I was curious about what methods you use to

RE: [PHP] Math Weirdness

2008-07-14 Thread Alex Chamberlain
> On Mon, Jul 14, 2008 at 3:51 PM, Daniel Brown <[EMAIL PROTECTED]> > wrote: > > > >You're performing math to get the result for $totChargeDiff by > > subtracting $totalCharges from $endingBal. That will give you -0.10 > > in this case, because 0.10 - 0.20 = -0.10. You want the difference, >

Re: [PHP] Math Weirdness

2008-07-14 Thread Daniel Brown
On Mon, Jul 14, 2008 at 3:54 PM, Daniel Brown <[EMAIL PROTECTED]> wrote: > >Oh, and the code, by the way: > > // your code to this point > > /* what is the difference between the ending balance and the charges? */ >$totChargeDiff = ($totalCharges > $endingBal) ? > ($en

RE: [PHP] mkdir permission errors

2008-07-14 Thread Robert Cummings
On Mon, 2008-07-14 at 15:49 -0400, Wei, Alice J. wrote: > Hi, Rob: > > I did follow the instruction of putting in chown apache:apache htdocs. Now > when I run the ls -la command, I get this: > > [EMAIL PROTECTED] apache]# ls -la > total 68 > drwxr-xr-x 15 root root4096 2008-06-24 09:36 .

[PHP] Should I go with the Singleton Pattern or wait for 5.3?

2008-07-14 Thread Luigi Perroti
Hello, I'm planning out a simple project and most probably I will need the functionality provided by the Singleton pattern. However with the next 5.3 release I would be able to conveniently use classes directly without instancing them. This would be a comparable option thanks to late state binding

[PHP] Re: Saving loading time at counting rows

2008-07-14 Thread tedd
At 6:13 PM +0200 7/13/08, Joep Roebroek wrote: I think, I will store the count and update it every 24 hours like tedd, says. I have thought of that earlier but was woundering if there might be another method. But I am wondering how google estimates the number of results, but I think that is a mo

Re: [PHP] Math Weirdness

2008-07-14 Thread Daniel Brown
On Mon, Jul 14, 2008 at 3:51 PM, Daniel Brown <[EMAIL PROTECTED]> wrote: > >You're performing math to get the result for $totChargeDiff by > subtracting $totalCharges from $endingBal. That will give you -0.10 > in this case, because 0.10 - 0.20 = -0.10. You want the difference, > not the resu

RE: [PHP] mkdir permission errors

2008-07-14 Thread Wei, Alice J.
Hi, Rob: I did follow the instruction of putting in chown apache:apache htdocs. Now when I run the ls -la command, I get this: [EMAIL PROTECTED] apache]# ls -la total 68 drwxr-xr-x 15 root root4096 2008-06-24 09:36 . drwxr-xr-x 13 root root4096 2008-07-14 08:53 .. drwxr-xr-x 2 roo

Re: [PHP] Math Weirdness

2008-07-14 Thread Daniel Brown
On Mon, Jul 14, 2008 at 1:39 PM, Jay Blanchard <[EMAIL PROTECTED]> wrote: > I am totally buffaloed by a set of very simple calculations that I am > doing; > >$totChargeDiff = $endingBal - $totalCharges; >echo number_format($totChargeDiff, 2, '.', '')."\t"; You'r

Re: [PHP] Math Weirdness

2008-07-14 Thread tedd
At 12:39 PM -0500 7/14/08, Jay Blanchard wrote: Each number represented by a variable in all of these calculations has been rounded to 2 decimal points at the point they are generated. For the most part this works just hunky-dory but I have a handful of calcs (out of 300k plus records) that look

RE: [PHP] mkdir permission errors

2008-07-14 Thread Robert Cummings
On Mon, 2008-07-14 at 15:37 -0400, Wei, Alice J. wrote: > Hi, Rob: > > Here is the updated version from the correct command: > > [EMAIL PROTECTED] htdocs]# ps awxu | grep -E 'apache|httpd' > root 30957 0.0 0.5 27576 11016 ?Ss 14:27 0:00 > /usr/sbin/httpd > apache 30959 0.

RE: [PHP] Math Weirdness

2008-07-14 Thread Robert Cummings
On Mon, 2008-07-14 at 14:29 -0500, Jay Blanchard wrote: > [snip] > Isn't it possible then that your data is out of synch between the > current balance and the previous day's ending balance? > [/snip] > > No, the values are there and correct (it is done with a snapshot). The > correct numbers are b

RE: [PHP] mkdir permission errors

2008-07-14 Thread Wei, Alice J.
Hi, Rob: Here is the updated version from the correct command: [EMAIL PROTECTED] htdocs]# ps awxu | grep -E 'apache|httpd' root 30957 0.0 0.5 27576 11016 ?Ss 14:27 0:00 /usr/sbin/httpd apache 30959 0.0 0.3 27708 7452 ?S14:27 0:00 /usr/sbin/httpd apache 3

RE: [PHP] Math Weirdness

2008-07-14 Thread Robert Cummings
On Mon, 2008-07-14 at 15:33 -0400, Wolf wrote: > Robert Cummings <[EMAIL PROTECTED]> wrote: > > On Mon, 2008-07-14 at 14:12 -0500, Jay Blanchard wrote: > > > [snip] > > > So again... from whence do you conjure $endingBal? :) > > > [/snip] > > > > > > $endingBal is conjured from the database

RE: [PHP] mkdir permission errors

2008-07-14 Thread Robert Cummings
On Mon, 2008-07-14 at 15:23 -0400, Wei, Alice J. wrote: > Hi, Rob: > > This is the output: > > root 31232 0.0 0.0 4120 672 pts/1R+ 15:22 0:00 grep > apache|httpd > > Does this help? Sorry... my bad, can you do the following: ps awxu | grep -E 'apache|httpd' I hav

RE: [PHP] Math Weirdness

2008-07-14 Thread Wolf
Robert Cummings <[EMAIL PROTECTED]> wrote: > On Mon, 2008-07-14 at 14:12 -0500, Jay Blanchard wrote: > > [snip] > > So again... from whence do you conjure $endingBal? :) > > [/snip] > > > > $endingBal is conjured from the database tracking the account balance. > > For any 24 hour period the

RE: [PHP] Math Weirdness

2008-07-14 Thread Jay Blanchard
[snip] Isn't it possible then that your data is out of synch between the current balance and the previous day's ending balance? [/snip] No, the values are there and correct (it is done with a snapshot). The correct numbers are being used in the math (as shown). When I do this(as you suggested)

RE: [PHP] Math Weirdness

2008-07-14 Thread Robert Cummings
On Mon, 2008-07-14 at 14:12 -0500, Jay Blanchard wrote: > [snip] > So again... from whence do you conjure $endingBal? :) > [/snip] > > $endingBal is conjured from the database tracking the account balance. > For any 24 hour period the beginning and ending balance for subsequent > days is the same

RE: [PHP] mkdir permission errors

2008-07-14 Thread Wei, Alice J.
Hi, Rob: This is the output: root 31232 0.0 0.0 4120 672 pts/1R+ 15:22 0:00 grep apache|httpd Does this help? Alice == Alice Wei MIS 2009 School of Library and Information Science Indiana University Bloomington [EMAIL

RE: [PHP] mkdir permission errors

2008-07-14 Thread Robert Cummings
On Mon, 2008-07-14 at 15:11 -0400, Wei, Alice J. wrote: > Hi, > >The apache is running currently on root as the user. >The parent directory, test, is set to 0755. These are permissions btw, and not ownerships. Ownerships denote user and group owners of the directory... specifically the e

RE: [PHP] mkdir permission errors

2008-07-14 Thread Robert Cummings
On Mon, 2008-07-14 at 15:11 -0400, Wei, Alice J. wrote: > Hi, > >The apache is running currently on root as the user. >The parent directory, test, is set to 0755. >I have no problems making new directories directly from the terminal > prompt, and it does not give me user execution er

RE: [PHP] Math Weirdness

2008-07-14 Thread Alex Chamberlain
> I am totally buffaloed by a set of very simple calculations that I am > doing; > > /* calculate total balance with payments and adjustments */ > $totalBalance = $acct['BALANCE'] + $adjBalance; > echo number_format($totalBalance, 2, '.', '')."\t"; > > /* calculate total

RE: [PHP] mkdir permission errors

2008-07-14 Thread Wei, Alice J.
Hi, The apache is running currently on root as the user. The parent directory, test, is set to 0755. I have no problems making new directories directly from the terminal prompt, and it does not give me user execution errors like the one in the following. I am getting confused with wh

Re: [PHP] Freelance PHP development in India

2008-07-14 Thread tedd
At 12:20 PM +0800 7/14/08, Denis L. Menezes wrote: Dear friends. I am looking for freelance web developers in India. Can contact me? Thanks Denis Good luck. tedd -- --- http://sperling.com http://ancientstones.com http://earthstones.com -- PHP General Mailing List (http://www.php.ne

RE: [PHP] Math Weirdness

2008-07-14 Thread Jay Blanchard
[snip] So again... from whence do you conjure $endingBal? :) [/snip] $endingBal is conjured from the database tracking the account balance. For any 24 hour period the beginning and ending balance for subsequent days is the same unless adjustments or payments have been made to the account in that p

Re: [PHP] mkdir permission errors

2008-07-14 Thread Robert Cummings
On Mon, 2008-07-14 at 15:01 -0400, Wei, Alice J. wrote: > Hi, Guys: > >I have a very strange incident here that may seem very stupid. Since the > power went out last night, I have restarted my server. However, now the > permission is never working right. I have set the permission of my htdoc

Re: [PHP] Math Weirdness

2008-07-14 Thread Robert Cummings
On Mon, 2008-07-14 at 12:39 -0500, Jay Blanchard wrote: > I am totally buffaloed by a set of very simple calculations that I am > doing; > > /* calculate total balance with payments and adjustments */ > $totalBalance = $acct['BALANCE'] + $adjBalance; > echo number_format($totalBalance,

[PHP] mkdir permission errors

2008-07-14 Thread Wei, Alice J.
Hi, Guys: I have a very strange incident here that may seem very stupid. Since the power went out last night, I have restarted my server. However, now the permission is never working right. I have set the permission of my htdocs folder iof my Apache server to 0755, and then started executing

RE: [PHP] Math Weirdness

2008-07-14 Thread Jay Blanchard
[snip] What makes you think the problem is in this code? How about doing the following right before the block of code you've provided so that we can actually check the data with what you're using: [/snip] $adjBalance: 0 $intlLDCharges: 0.2 $longDistance: 0 $smsCharges: 0 $roaming: 0 $daCharges:

Re: [PHP] Math Weirdness

2008-07-14 Thread Robert Cummings
On Mon, 2008-07-14 at 12:39 -0500, Jay Blanchard wrote: > /* calculate total balance with payments and adjustments */ > $totalBalance = $acct['BALANCE'] + $adjBalance; > echo number_format($totalBalance, 2, '.', '')."\t"; > > /* calculate total charges */ >

[PHP] Math Weirdness

2008-07-14 Thread Jay Blanchard
I am totally buffaloed by a set of very simple calculations that I am doing; /* calculate total balance with payments and adjustments */ $totalBalance = $acct['BALANCE'] + $adjBalance; echo number_format($totalBalance, 2, '.', '')."\t"; /* calculate total charges *

Re: [PHP] Freelance PHP development in India

2008-07-14 Thread Robert Cummings
On Mon, 2008-07-14 at 11:01 +0300, Irimia, Suleapa wrote: > Wolf wrote: > > > > > > Denis L. Menezes wrote: > >> Dear friends. > >> > >> I am looking for freelance web developers in India. > >> > >> Can contact me? > >> > >> Thanks > >> Denis > >> > > Why just in India? There are a number of us

Re: [PHP] Freelance PHP development in India

2008-07-14 Thread Gabriel Sosa
why not argentina? On Mon, Jul 14, 2008 at 10:31 AM, Denis L. Menezes <[EMAIL PROTECTED]> wrote: > Dear Ryan, Wolf. > > Apologies for asking from India only. No offence meant. > > It is because I am from India and I can personally meet and discuss with > the programmers. Cost is also an issue.

Re: [PHP] case and accent - insensitive regular expression?

2008-07-14 Thread Giulio Mastrosanti
First of all thank you all for your answers, and thank you for your time and yes Tedd, my question was quite ambiguous in that point. Andrew is right, i don't want to change in any way the list of keys I show in the result, I just want to find the way to higlight the matching words, regar

Re: [PHP] Freelance PHP development in India

2008-07-14 Thread Denis L. Menezes
Dear Ryan, Wolf. Apologies for asking from India only. No offence meant. It is because I am from India and I can personally meet and discuss with the programmers. Cost is also an issue. Mine is a startup and the finances are low. :-( Apologies. Denis - Original Message - From: "Ry

Re: [PHP] need advice on a free DB hosting site

2008-07-14 Thread Eric Butera
On Mon, Jul 14, 2008 at 4:47 AM, Per Jessen <[EMAIL PROTECTED]> wrote: > willyam pax wrote: > >> hi >> hello everyone im stil new here i just want >> some advice...now im working on a database install script in >> phpjust a simple one... >> i just need to test it online thats why i need advice

Re: [PHP] Freelance PHP development in India

2008-07-14 Thread Ryan S
> Dear friends. > > I am looking for freelance web developers in India. > > Can contact me? > Why just in India? There are a number of us available via the world. Wolf I'm guessing because he wants a REAL cheap solution... what you (probably) charge for 5-7hrs work would probably be t

Re: [PHP] need advice on a free DB hosting site

2008-07-14 Thread Per Jessen
willyam pax wrote: > hi > hello everyone im stil new here i just want > some advice...now im working on a database install script in > phpjust a simple one... > i just need to test it online thats why i need advice on a database > hosting site that is free.. How about installing a database on

Re: [PHP] need advice on a free DB hosting site

2008-07-14 Thread Irimia, Suleapa
willyam pax wrote: hi hello everyone im stil new here i just want some advice...now im working on a database install script in phpjust a simple one... i just need to test it online thats why i need advice on a database hosting site that is free.. that also i can activate it with a username an

Re: [PHP] Freelance PHP development in India

2008-07-14 Thread Irimia, Suleapa
Wolf wrote: Denis L. Menezes wrote: Dear friends. I am looking for freelance web developers in India. Can contact me? Thanks Denis Why just in India? There are a number of us available via the world. Wolf Cause they are cheaper? __ //Just my 2 cents smime.p7s Description: S/MIM