php-general Digest 30 Dec 2009 10:08:09 -0000 Issue 6513

2009-12-30 Thread php-general-digest-help

php-general Digest 30 Dec 2009 10:08:09 - Issue 6513

Topics (messages 300731 through 300744):

Re: ip-to-country
300731 by: George Langley
300732 by: Nitsan Bin-Nun

Re: output buffer
300733 by: Bastien Koert
300736 by: Marc Fromm
300740 by: kranthi

Re: sending email with php
300734 by: George Langley

Re: Unable to get output from exec ssh remote-server 'ping -c4 ip'
300735 by: Adam Randall
300741 by: kranthi

Re: Multiple Inheritance Needed in OOP?
300737 by: Daniel Kolbo
300738 by: Daniel Egeberg
300739 by: Daniel Kolbo

not able to use mysql server
300742 by: Sudhakar
300743 by: Jignesh Thummar

Help with security configuration for a shared hosting environment
300744 by: robert mena

Administrivia:

To subscribe to the digest, e-mail:
php-general-digest-subscr...@lists.php.net

To unsubscribe from the digest, e-mail:
php-general-digest-unsubscr...@lists.php.net

To post to the list, e-mail:
php-gene...@lists.php.net


--
---BeginMessage---
	From my experience, I have had reported one incorrect country-level  
IP from Maxmind's paid service (returned US vrs Canada for a Canadian  
IP). But their free version is based on the commercial lists, just not  
updated as often, or automatically (you download and store locally on  
your server). So should be nearly as accurate as long as you maintain  
the lists (ie. think is weekly, being 2-weeks behind).
	That said, someone on another list is running a geo-location service  
comparison test, where you click links to the various services, then  
enter the location they returned. He was compiling the results, and so  
far has reported the following:

-QUOTE---
So far some crazy numbers and realities. Of these numbers,  all of the  
vendors missed 25 exact city locations equally. So our continued plan  
is to measure how far off the approx. 25% are so we can then say, OK,  
x vendor is 100% accurate up to x% and then x% accurate within say x-y  
miles. The shocking thing to us is still how some of the more  
expensive providers will say their definition of accuracy on a city  
level can be within 25 miles. Thus you would receive statistical  
confidence of a 90-100 for an IP that shows Pasadena, Calif. and yet  
in reality be located in Long Beach, Calif., or the same for San Jose,  
Ca. and yet be further up the peninsula in San Carlos, Ca.


total: 103

ip2: 55
quova: 46
ipiligence: 32
whatis: 62
maxmind: 63


By the way, we are obviously way short still on queries so if you  
haven't clicked on the link, please do so and follow some ez pz  
instructions:


http://www.stratosanalytics.com/iplookup.html

-END QUOTE---

	So help him out by clicking the link (although not sure what he means  
by e-zed-p-zed instructions ;-{)] )


George


On 14-Dec-09, at 5:07 AM, Angelo Zanetti wrote:




-Original Message-
From: George Langley [mailto:george.lang...@shaw.ca]
Sent: 19 October 2009 01:38 AM
To: php-gene...@lists.php.net
Subject: Re: [PHP] ip-to-country

On 18-Oct-09, at 1:03 PM, SED wrote:


How can I access an index for IP to a country (or a more detailed
location)?


http://www.maxmind.com/app/ip-location

has both free and various paid services.

George


Hi George,

How accurate are the free ones compared to the paid ones?

Regards
Angelo

http://www.elemental.co.za
http://www.wapit.co.za




---End Message---
---BeginMessage---
easy-peasy :)

I have nothing to add to the discussion, my experience is only with
Maxmind's free database, and it is definitely not accurate at Israel.

On Tue, Dec 29, 2009 at 11:14 PM, George Langley george.lang...@shaw.cawrote:

From my experience, I have had reported one incorrect country-level
 IP from Maxmind's paid service (returned US vrs Canada for a Canadian IP).
 But their free version is based on the commercial lists, just not updated as
 often, or automatically (you download and store locally on your server). So
 should be nearly as accurate as long as you maintain the lists (ie. think is
 weekly, being 2-weeks behind).
That said, someone on another list is running a geo-location service
 comparison test, where you click links to the various services, then enter
 the location they returned. He was compiling the results, and so far has
 reported the following:
 -QUOTE---
 So far some crazy numbers and realities. Of these numbers,  all of the
 vendors missed 25 exact city locations equally. So our continued plan is to
 measure how far off the approx. 25% are so we can then say, OK, x vendor is
 100% accurate up to x% and then x% accurate within say x-y miles. The
 shocking thing to us is still how some of the more expensive providers will
 say their definition of accuracy on a city level can be within 25 miles.
 Thus you would 

php-general Digest 31 Dec 2009 03:45:54 -0000 Issue 6514

2009-12-30 Thread php-general-digest-help

php-general Digest 31 Dec 2009 03:45:54 - Issue 6514

Topics (messages 300745 through 300750):

Re: not able to use mysql server
300745 by: Eric Lee

If design patterns are not supposed to produce reusable code then why use them?
300746 by: Tony Marston
300747 by: Ashley Sheridan
300748 by: tedd
300749 by: Paul M Foster

Survey+Report in PHP
300750 by: aditya shukla

Administrivia:

To subscribe to the digest, e-mail:
php-general-digest-subscr...@lists.php.net

To unsubscribe from the digest, e-mail:
php-general-digest-unsubscr...@lists.php.net

To post to the list, e-mail:
php-gene...@lists.php.net


--
---BeginMessage---
On 12/30/09, Jignesh Thummar jignesh.thum...@gmail.com wrote:

 It is problem with mysql client, it's not able to connect with mysql
 server.
 Either mysql server is not running or windows firewall is blocking to the
 access of port 3306. Try to disable firewall.

 -Jignesh

 On Wed, Dec 30, 2009 at 11:41 AM, Sudhakar sudhakarar...@gmail.com
 wrote:

  hi
 
  i am using windows vista and installed wamp server, initially i installed
  wamp and accessed phpmyadmin and while setting a password for the root i
  did
  a mistake and could not access phpmyadmin and also renamed some php files
  so
  i uninstalled wamp server and re installed
 
  now the problem i am facing is when i click on mysql.exe located at
  D:\wamp\bin\mysql\mysql5.1.36\bin i am getting the following error
  error 2003 cant connect to Mysql server on localhost 10061
 
  in config.inc.php located at d:\wamp\apps\phpmyadmin3.2.0.1 i have the
  following
  $cfg['Servers'][$i]['host'] = 'localhost';
  $cfg['Servers'][$i]['port'] = '3306';
  $cfg['Servers'][$i]['auth_type'] = 'config';
  $cfg['Servers'][$i]['user'] = 'root';
  $cfg['Servers'][$i]['password'] = 'root';
  $cfg['Servers'][$i]['AllowNoPassword'] = true;
 
  along with others.
 
  when i type http://localhost i am able to see the welcome screen of wamp
  and
  can click on phpinfo but when i click on phpmyadmin it takes a while to
  load
  and a blank screen appears
 
  also i have stopped all services and restarted all services from the
  wampserver icon in the system tray, normally the colors change from red
 to
  yellow to white, the color is at yellow and does not change to white
 
  how do i solve the error error 2003 cant connect to Mysql server on
  localhost 10061 so that i can use phpmyadmin
 
  please advice.
 
  thanks.
 


Are there any error entries of mysql server on the event viewer ?
Also, what is the starting state of mysql server on the services console ?
You can found all tool on administrative folder on the start menu.
---End Message---
---BeginMessage---
I have recently been engaged in an argument via email with someone who 
criticises my low opinion of design patterns (refer to 
http://www.tonymarston.net/php-mysql/design-patterns.html ). He says that 
design patterns are merely a convention and not a reusable component. My 
argument is that something called a pattern is supposed to have a recurring 
theme, some element of reusability, so that all subsequent implementations 
of a pattern should require less effort than the first implementation. If 
design patterns do not provide any reusable code then what is the point of 
using them?



I do not use design patterns as I consider them to be the wrong level of 
abstraction. I am in the business of designing and developing entire 
applications which comprise of numerous application transactions, so I much 
prefer to use transaction patterns (refer to 
http://www.tonymarston.net/php-mysql/design-patterns-are-dead.html and 
http://www.tonymarston.net/php-mysql/transaction-patterns.html ) as these 
provide large amounts of reusable code and are therefore a significant aid 
to programmer productivity.



What is your opinion? Are design patterns supposed to provide reusable code 
or not? If not, and each implementation of a pattern takes just as much time 
as the first, then where are the productivity gains from using design 
patterns?


-- 
Tony Marston
http://www.tonymarston.net
http://www.radicore.org 


---End Message---
---BeginMessage---
On Wed, 2009-12-30 at 16:50 +, Tony Marston wrote:

 I have recently been engaged in an argument via email with someone who 
 criticises my low opinion of design patterns (refer to 
 http://www.tonymarston.net/php-mysql/design-patterns.html ). He says that 
 design patterns are merely a convention and not a reusable component. My 
 argument is that something called a pattern is supposed to have a recurring 
 theme, some element of reusability, so that all subsequent implementations 
 of a pattern should require less effort than the first implementation. If 
 design patterns do not provide any reusable code then what is the point of 
 using them?
 
 
 
 I do not use design patterns as I consider them to be the 

[PHP] Help with security configuration for a shared hosting environment

2009-12-30 Thread robert mena
Hi,

I am setting a shared hosting server and I'd like to gather some advices
regarding the security. Since the code will not be produced by me I'd like
to focus on environment strategies.

For now I've added a noexec in the mount options of the /tmp and the homedir
of the web server, disabled the devel tools (such as gcc).

In terms of the PHP I am inclined to use mod_suPHP to avoid having the
problem with the script generated files (such as uploads) being owned by the
webserver itself and I'd like to use the available php.ini options to try to
make it harder for an attacker to cause problems.

I will disable the register_globals and the allow url fopen.  But what else
can I do (open_basedir/doc_root/safe_mode etc)?

I need to allow the user to access the pear classes.

Using linux/php 5.2.x

Regards.


Re: [PHP] not able to use mysql server

2009-12-30 Thread Eric Lee
On 12/30/09, Jignesh Thummar jignesh.thum...@gmail.com wrote:

 It is problem with mysql client, it's not able to connect with mysql
 server.
 Either mysql server is not running or windows firewall is blocking to the
 access of port 3306. Try to disable firewall.

 -Jignesh

 On Wed, Dec 30, 2009 at 11:41 AM, Sudhakar sudhakarar...@gmail.com
 wrote:

  hi
 
  i am using windows vista and installed wamp server, initially i installed
  wamp and accessed phpmyadmin and while setting a password for the root i
  did
  a mistake and could not access phpmyadmin and also renamed some php files
  so
  i uninstalled wamp server and re installed
 
  now the problem i am facing is when i click on mysql.exe located at
  D:\wamp\bin\mysql\mysql5.1.36\bin i am getting the following error
  error 2003 cant connect to Mysql server on localhost 10061
 
  in config.inc.php located at d:\wamp\apps\phpmyadmin3.2.0.1 i have the
  following
  $cfg['Servers'][$i]['host'] = 'localhost';
  $cfg['Servers'][$i]['port'] = '3306';
  $cfg['Servers'][$i]['auth_type'] = 'config';
  $cfg['Servers'][$i]['user'] = 'root';
  $cfg['Servers'][$i]['password'] = 'root';
  $cfg['Servers'][$i]['AllowNoPassword'] = true;
 
  along with others.
 
  when i type http://localhost i am able to see the welcome screen of wamp
  and
  can click on phpinfo but when i click on phpmyadmin it takes a while to
  load
  and a blank screen appears
 
  also i have stopped all services and restarted all services from the
  wampserver icon in the system tray, normally the colors change from red
 to
  yellow to white, the color is at yellow and does not change to white
 
  how do i solve the error error 2003 cant connect to Mysql server on
  localhost 10061 so that i can use phpmyadmin
 
  please advice.
 
  thanks.
 


Are there any error entries of mysql server on the event viewer ?
Also, what is the starting state of mysql server on the services console ?
You can found all tool on administrative folder on the start menu.


[PHP] If design patterns are not supposed to produce reusable code then why use them?

2009-12-30 Thread Tony Marston
I have recently been engaged in an argument via email with someone who 
criticises my low opinion of design patterns (refer to 
http://www.tonymarston.net/php-mysql/design-patterns.html ). He says that 
design patterns are merely a convention and not a reusable component. My 
argument is that something called a pattern is supposed to have a recurring 
theme, some element of reusability, so that all subsequent implementations 
of a pattern should require less effort than the first implementation. If 
design patterns do not provide any reusable code then what is the point of 
using them?



I do not use design patterns as I consider them to be the wrong level of 
abstraction. I am in the business of designing and developing entire 
applications which comprise of numerous application transactions, so I much 
prefer to use transaction patterns (refer to 
http://www.tonymarston.net/php-mysql/design-patterns-are-dead.html and 
http://www.tonymarston.net/php-mysql/transaction-patterns.html ) as these 
provide large amounts of reusable code and are therefore a significant aid 
to programmer productivity.



What is your opinion? Are design patterns supposed to provide reusable code 
or not? If not, and each implementation of a pattern takes just as much time 
as the first, then where are the productivity gains from using design 
patterns?


-- 
Tony Marston
http://www.tonymarston.net
http://www.radicore.org 



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



Re: [PHP] If design patterns are not supposed to produce reusable code then why use them?

2009-12-30 Thread Ashley Sheridan
On Wed, 2009-12-30 at 16:50 +, Tony Marston wrote:

 I have recently been engaged in an argument via email with someone who 
 criticises my low opinion of design patterns (refer to 
 http://www.tonymarston.net/php-mysql/design-patterns.html ). He says that 
 design patterns are merely a convention and not a reusable component. My 
 argument is that something called a pattern is supposed to have a recurring 
 theme, some element of reusability, so that all subsequent implementations 
 of a pattern should require less effort than the first implementation. If 
 design patterns do not provide any reusable code then what is the point of 
 using them?
 
 
 
 I do not use design patterns as I consider them to be the wrong level of 
 abstraction. I am in the business of designing and developing entire 
 applications which comprise of numerous application transactions, so I much 
 prefer to use transaction patterns (refer to 
 http://www.tonymarston.net/php-mysql/design-patterns-are-dead.html and 
 http://www.tonymarston.net/php-mysql/transaction-patterns.html ) as these 
 provide large amounts of reusable code and are therefore a significant aid 
 to programmer productivity.
 
 
 
 What is your opinion? Are design patterns supposed to provide reusable code 
 or not? If not, and each implementation of a pattern takes just as much time 
 as the first, then where are the productivity gains from using design 
 patterns?
 
 
 -- 
 Tony Marston
 http://www.tonymarston.net
 http://www.radicore.org 
 
 
 


In my opinion, patterns primarily aid development of systems where more
than one person will be working on it, or where more people may need to
refer to the code in the future as a basis for something else.

Programming essentially is about not reinventing the wheel all the time,
by reusing ideas either as they stand, or as a base for improving upon.
To an extent, I think every programmer uses design patterns, it's just a
matter of how complex a pattern one uses, and how closely one stays to
the original pattern.

Thanks,
Ash
http://www.ashleysheridan.co.uk




Re: [PHP] If design patterns are not supposed to produce reusable code then why use them?

2009-12-30 Thread tedd

At 4:50 PM + 12/30/09, Tony Marston wrote:

What is your opinion? Are design patterns supposed to provide reusable code
or not? If not, and each implementation of a pattern takes just as much time
as the first, then where are the productivity gains from using design
patterns?

--
Tony Marston


Tony:

I don't think reusable code is the main point of Design Patterns. 
From what I've read, Design Patterns are more of a If you are 
faced with this problem, here's a solution kind of thing. Reusable 
code is more a by-product of the process.


Instead Design Patterns are more about identifying and classifying 
common problems than reusable code. The point is if you can define 
your problem as a category referenced by Design Patterns, then you 
are closer to solving it.


With that said, I find Design Patterns frustrating because of the 
level of abstraction most authors use to identify the 
problem/solution pair. Instead of showing a real world example, their 
solution are so broad, so encompassing, so abstract, that they lose 
me.


However, I must admit that the newer ways of doing things are 
bringing to the table ways to do things that were not possible 
before. So, in the end we all have to keep learning just to keep up. 
As I've said many times before I've learned something new every day 
of my life -- and I'm getting damned tried of 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] If design patterns are not supposed to produce reusable code then why use them?

2009-12-30 Thread Paul M Foster
On Wed, Dec 30, 2009 at 04:50:40PM -, Tony Marston wrote:

 I have recently been engaged in an argument via email with someone who
 criticises my low opinion of design patterns (refer to
 http://www.tonymarston.net/php-mysql/design-patterns.html ). He says that
 design patterns are merely a convention and not a reusable component. My
 argument is that something called a pattern is supposed to have a recurring
 theme, some element of reusability, so that all subsequent implementations
 of a pattern should require less effort than the first implementation. If
 design patterns do not provide any reusable code then what is the point of
 using them?
 

There's a weird terminology problem here. A design pattern is just an
idea. Once you implement it, it can become a source of reusable code.

 
 
 I do not use design patterns as I consider them to be the wrong level of
 abstraction. I am in the business of designing and developing entire
 applications which comprise of numerous application transactions, so I much
 prefer to use transaction patterns (refer to
 http://www.tonymarston.net/php-mysql/design-patterns-are-dead.html and
 http://www.tonymarston.net/php-mysql/transaction-patterns.html ) as these
 provide large amounts of reusable code and are therefore a significant aid
 to programmer productivity.
 
 
 
 What is your opinion? Are design patterns supposed to provide reusable code
 or not? If not, and each implementation of a pattern takes just as much time
 as the first, then where are the productivity gains from using design
 patterns?
 

It depends on how you implement it. You can prevent it from being
reusable by implementing it in such a way that there's just no way to
adapt it to different circumstances.

But for the most part, it's like any other code you expect to reuse,
whether it's just a function, a plain class or whatever. If you
implement it properly, it will be reusable elsewhere. 

Paul

-- 
Paul M. Foster

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



[PHP] Survey+Report in PHP

2009-12-30 Thread aditya shukla
Hello Guys,

I am trying to make a web app which has a survey and report based on the
survey.The app is like a suvery and I have to generate a report based on the
survey.Can someone please give a clue of how to generate the report .I have
the answers to the questions of the survey and based on them a report will
be generated.

Thanks

Aditya


[PHP] Re: Survey+Report in PHP

2009-12-30 Thread aditya shukla
Sorry for the vague question.

This is how the survey is.We have some question and answers to that
questions.Some answers have multiple options(drop down) and some answers are
to be entered in a text box.My aim s to get the answers and generate the
report based on the answers (by using some mathematical formula's on the
answers).

The report would contain a paragraphs depending on what answers are selected
or entered.

My question is for some answers the result is fixed say

What's your fav color?

options:white/black/red/green

Answer:-white.

Report You are a peace loving person. (similarly for other colors).But for
some questions the answers are to be generated on the fly.

How long do you sleep ?

text box:- 12 hours.

report:-You are a lazy person.(here the answer depends on the value entered
in the text box.

So i cannot save the results in a table.So should i store some of the
answers in the database?How should i go about this.

Thanks
Aditya


[PHP] PHP excel graph generator

2009-12-30 Thread Manoj Singh
Hi,

I have the task to create excel sheet with embedded charts and graphs
through PHP. The charts are pie chart and bar chart. The project will be run
on the linux server. My question is it is possible to implement this through
PHP? If yes, then please suggest the available implementations.

Thanks in advance.

Regards,
Manoj


[PHP] Happy New Year All!

2009-12-30 Thread paragasu
?php

/** this going to be a long wish from Malaysia
 *  @author paragasu
 */

do { echo 'wish you .. \n'; } (date('Y')  2010) ;
exit (' Happy New Year');


?

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