Re: [PHP] What would you like to see in most in a text editor?

2011-09-16 Thread Marco Lanzotti
Il 13/09/2011 21:56, Brad Huskins ha scritto:
> So I would like to get some feedback on what features people would
> most want, since I am still at a very flexible stage in development.

Configurable syntax highlight, autoindent and autocomplete.

Bye,
Marco

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



Re: [PHP] Re: Repetitive answers . . .

2011-09-16 Thread Joshua Stoutenburg
On Fri, Sep 16, 2011 at 12:35 AM, tamouse mailing lists
>
> My baboon is offended.
>

class baboon extends human
{
   $ammo = '';

   public __construct($ammo)
   {
   $this->ammo = $ammo;
   }

   public function flingAt($target)
   {
   $target->flingAlert($this, $this->ammo);
   }

   public function flingAlert($source, $missile)
   {
   $hit = rand(0,1);
   if ($hit == 1)
   {
$this->screech();
   }
   else {
$this->howl();
   }

   // regardless, return the favor
   $this->flingAt($souce);
   }

   private function howl()
   {
echo "Oooaa-oooaa";
   }

   private function screech()
   {
echo "E";
   }
}

$ammo = "stuff";
$me = new baboon($ammo);
$you = new baboon($ammo);
$me->flingAt($you);

// :) This is pretty fun :)

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



Re: [PHP] Re: Repetitive answers . . .

2011-09-16 Thread tamouse mailing lists
On Thu, Sep 15, 2011 at 8:31 PM, Joshua Stoutenburg
 wrote:
> // I hope everyone finds this more humorous than offensive.

My baboon is offended.

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



Re: [PHP] What would you like to see in most in a text editor?

2011-09-16 Thread Joshua Stoutenburg
On Fri, Sep 16, 2011 at 12:51 AM, Marco Lanzotti  wrote:
> Il 13/09/2011 21:56, Brad Huskins ha scritto:
>> So I would like to get some feedback on what features people would
>> most want, since I am still at a very flexible stage in development.
>

I wouldn't want a text editor. I'd want an IDE.

debugging - runtime control, watches, breakpoints, call stack, etc
syntax highlighting
project level intelligence (Ctrl+Click on usage of a function,
variable, class, etc takes you to the definition, as ONE example)
phpdoc, javadoc, etc auto-completion and referencing
function/parameter hinting
integration with Git
task list generated from customizable keyword comments like TODO
multiple coding languages (PHP, CSS, Javascript, HTML, SQL, etc, etc)
find and replace within selection, file, files, directories, etc.
(with regex too)
FAST (unlike Dreambeaver)

Netbeans and Eclipse have all/many of these features.

I started out with Notepad++. It's a text editor trying really really
hard to be an IDE.

I mostly use Netbeans. But in the future I will primarily use Eclipse
as I do more work in Java, Android, and Python.

Love the IDE for projects. Never going back.

I still use Notepad++ for editing config files.

-- Josh --
Web Developer
PHP, SQL, HTML, CSS, Javascript, AJAX

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



Re: [PHP] Re: What would you like to see in most in a text editor?

2011-09-16 Thread tamouse mailing lists
On Wed, Sep 14, 2011 at 5:07 PM, Jonesy  wrote:
> On Wed, 14 Sep 2011 14:08:09 +0100, Richard Quadling wrote:
>> On 14 September 2011 13:18, Tim Streater  wrote:
>>> On 14 Sep 2011 at 12:40, Richard Quadling  wrote:
 On 14 September 2011 01:23, tamouse wrote:
> On Tue, Sep 13, 2011 at 3:35 PM, Robert Cummings wrote:
>> I'm a big fan of editors that work in the terminal.
>
> You'll get my emacs when you pry it out of my cold dead hands.

 Pah! You and your full screen editor.

 EDLIN is the way to go.
>>>
>>> Is that more or less terse than TECO?
>>>
>>
>> TECO - OUCH.
>
> heh.  I built my first website with WordStar 6.0 under OS/2.
>
> Jonesy -- yup, I've used TECO, too -- on an ASR-35 TTY

I declare a winner.

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



Re: [PHP] lost return value during a static call

2011-09-16 Thread Johan Lidström
On 15 September 2011 15:57, Robert Williams  wrote:

>
> On Sep 15, 2011, at 6:03, "chamila gayan"  wrote:
>
> > when it goes through 2 static methods, at some point it stops returning
> > value to the calling method. (please see comments in-line).
>
> The getArray() method and the 'else' portion of the getChild() method both
> lack a return statement, so they're basically just tossing out whatever
> value they come up with.
>
> --
> Bob Williams
>
> Notice: This communication, including attachments, may contain information
> that is confidential. It constitutes non-public information intended to be
> conveyed only to the designated recipient(s). If the reader or recipient of
> this communication is not the intended recipient, an employee or agent of
> the intended recipient who is responsible for delivering it to the intended
> recipient, or if you believe that you have received this communication in
> error, please notify the sender immediately by return e-mail and promptly
> delete this e-mail, including attachments without reading or saving them in
> any manner. The unauthorized use, dissemination, distribution, or
> reproduction of this e-mail, including attachments, is prohibited and may be
> unlawful. If you have received this email in error, please notify us
> immediately by e-mail or telephone and delete the e-mail and the attachments
> (if any).
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>
Confirmed, putting a return statement on lines 16 and 26 yields the expected
result.

-- 
"It is not possible to simultaneously understand and appreciate the Intel
architecture" --Ben Scott


[PHP] Help on number matching function

2011-09-16 Thread Dare Williams
Dear PHP Group,

I need a Function of any category in  either PHP or MySQL RDBMS customize 
Function, Class, Methods or anything that could help me compare a particular 
set of number and return their matching result. e.g If I have a 5 Digits set of 
number  and need to match it with another set of five  digits and return how 
many number are match and the figures that are match. 

1.    (62,39,47,25,14) - (14,39,62,25,47) - match 5 (all)
2.    (55,11,27,62,39) - (66,39,12,13,27) - match 2 (27,39)
3.    (20,04,56,17,16) - (16,01,17,04,79) - match 3 (16,17,04)

Any Help will be appreciated.

Thank you.


Re: [PHP] Re: Repetitive answers . . .

2011-09-16 Thread Robert Cummings

On 11-09-15 09:31 PM, Joshua Stoutenburg wrote:

class baboon
{
 $ammo = '';

 public __construct($ammo)
 {
 $this->ammo = $ammo;
 }

 public function flingAt($target)
 {
 $target->flingAlert($this->ammo);
 }
}


$me = new baboon($information);
$you = new baboon();
$me->flingAt($you);


I'm sorry, but this is unnacceptably ambiguous. Due to the poor design I 
don't know whether to duck or open my mouth for a treat. Let's make the 
program a bit more flexible and useful...


flingAlert( $something, $target );
}

public function openMouth()
{
echo "Aaah\n";
}

public function evade()
{
if( rand( 1, 100 ) <= 70 )
{
echo "Pheeew! That was close.\n";
}
else
{
echo "SPLAT!\n";
}
}

public function flingAlert( $something, $target )
{
switch( $something )
{
case 'treat':
{
$this->openMouth();
break;
}

default:
{
$this->evade();
break;
}
}
}
}

$me = new baboon();
$you = new baboon();

$me->fling( 'scooby snack', $you );
$me->fling( 'poo', $you );

?>

I love Friday :)

Cheers,
Rob.
--
E-Mail Disclaimer: Information contained in this message and any
attached documents is considered confidential and legally protected.
This message is intended solely for the addressee(s). Disclosure,
copying, and distribution are prohibited unless authorized.

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



Re: [PHP] Help on number matching function

2011-09-16 Thread Robert Williams
On Sep 16, 2011, at 6:02, "Dare Williams"  wrote:

>
>  I have a 5 Digits set of number  and need to match it with another set of 
> five  digits and return how many number are match and the figures that are 
> match.


Check out array_intersect().



--
Bob Williams

Notice: This communication, including attachments, may contain information that 
is confidential. It constitutes non-public information intended to be conveyed 
only to the designated recipient(s). If the reader or recipient of this 
communication is not the intended recipient, an employee or agent of the 
intended recipient who is responsible for delivering it to the intended 
recipient, or if you believe that you have received this communication in 
error, please notify the sender immediately by return e-mail and promptly 
delete this e-mail, including attachments without reading or saving them in any 
manner. The unauthorized use, dissemination, distribution, or reproduction of 
this e-mail, including attachments, is prohibited and may be unlawful. If you 
have received this email in error, please notify us immediately by e-mail or 
telephone and delete the e-mail and the attachments (if any).

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



Re: [PHP] Help on number matching function

2011-09-16 Thread Ken Robinson

At 08:36 AM 9/16/2011, Dare Williams wrote:
Dear PHP Group, I need a Function of any category in  either PHP or 
MySQL RDBMS customize Function, Class, Methods or anything that 
could help me compare a particular set of number and return their 
matching result. e.g If I have a 5 Digits set of number  and need to 
match it with another set of five  digits and return how many number 
are match and the figures that are match. 1.(62,39,47,25,14) - 
(14,39,62,25,47) - match 5 (all) 2.(55,11,27,62,39) - 
(66,39,12,13,27) - match 2 (27,39) 3.(20,04,56,17,16) - 
(16,01,17,04,79) - match 3 (16,17,04) Any Help will be appreciated. Thank you.


Turn your sets of number into an array and then use the function 
array_intersect, http://php.net/array_intersect


Ken



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



Re: [PHP] Re: Repetitive answers . . .

2011-09-16 Thread Daniel Brown
On Thu, Sep 15, 2011 at 21:31, Joshua Stoutenburg  wrote:
>
> But let me put a spin on it:
>
> 
> $information = <<
> I got a great idea, why don't we write hundreds of books and websites
> with all of our repetitive answers and call it the "information age".
> Who cares if all the priceless pearls of rare knowledge are buried,
> lost, and irretrievable.  We'll have the information age!
>
> Then, after we've ushered in the information age, we'll invent a
> search bot to crawl all over the heap of information and fling it
> around whenever somebody asks for it!
>
> Then, we'll all sit around on a mailing list, and when somebody comes
> in seeking refuge from the flinging search bot, looking for some rare
> piece of information, we'll fling all the common stuff at him instead!
>  It will be hilarious!
>
> EOF;
>
>
> class baboon
> {
>    $ammo = '';

Parse error.  You probably mean: var $ammo;

>    public __construct($ammo)

Parse error.  You probably mean: public function __construct($ammo)

>    {
>        $this->ammo = $ammo;
>    }
>
>    public function flingAt($target)
>    {
>        $target->flingAlert($this->ammo);

Fatal error.  Unless you meant to create infinite recursion with
baboon::flingAt().

>    }
> }
>
>
> $me = new baboon($information);
> $you = new baboon();

Since you didn't have a fallback definition in your __construct(),
this will throw a missing argument warning.  It will also then give an
undefined variable warning when it tries to define baboon::$ammo.

> $me->flingAt($you);

Trying to work with an object here?  Since we're missing the
baboon::flingAlert() definition, I'm curious to see how the object is
handled.


Oh, Friday

-- 

Network Infrastructure Manager
http://www.php.net/

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



Re: [PHP] XML enabled but not working

2011-09-16 Thread Richard Quadling
On 15 September 2011 21:20, Matthew Pounsett  wrote:
> Anyone have any thoughts on what to look at?

php -m

look for XML

php --rf xml_parser_create

look for

Function [  function xml_parser_create ] {

  - Parameters [1] {
Parameter #0 [  $encoding ]
  }
}


-- 
Richard Quadling
Twitter : EE : Zend : PHPDoc
@RQuadling : e-e.com/M_248814.html : bit.ly/9O8vFY : bit.ly/lFnVea

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



[PHP] Round with money_format

2011-09-16 Thread Cyril Lopez
Hi,

Can someone help me understand how money_format() rounds numbers ?



Misconfiguration ? Bug ?
Thanks !

Cyril

Config :
Debian Lenny, PHP 5.3.8

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



Re: [PHP] Round with money_format

2011-09-16 Thread Richard Quadling
On 16 September 2011 15:58, Cyril Lopez  wrote:
> Hi,
>
> Can someone help me understand how money_format() rounds numbers ?
>
>   setlocale(LC_ALL, 'fr_FR.UTF-8');
>  $price = 12.665;
>  echo money_format('%i',$price);
>  // 12.66 EUR, 12.67 EUR expected
>
>  $price2 = 12.666;
>  echo money_format('%i',$price2);
>  // 12.67 EUR, ok
>
>  echo round($price,2);
>  // 12.67, ok
>  echo round($price2,2);
>  // 12.67, ok
> ?>
>
> Misconfiguration ? Bug ?
> Thanks !
>
> Cyril

Each locale can define its own rules regarding the number of digits to
show, but I can't see anything that covers the rounding.

OOI.

What do you get for 12.66999?

I'm on windows and there's no money_format function (due to a lack of
strfmon() function),


-- 
Richard Quadling
Twitter : EE : Zend : PHPDoc
@RQuadling : e-e.com/M_248814.html : bit.ly/9O8vFY : bit.ly/lFnVea

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



Re: [PHP] Round with money_format

2011-09-16 Thread Stuart Dallas
On 16 Sep 2011, at 15:58, Cyril Lopez wrote:

> Can someone help me understand how money_format() rounds numbers ?
> 
>   setlocale(LC_ALL, 'fr_FR.UTF-8');
>  $price = 12.665;
>  echo money_format('%i',$price);
>  // 12.66 EUR, 12.67 EUR expected
> 
>  $price2 = 12.666;
>  echo money_format('%i',$price2);
>  // 12.67 EUR, ok
> 
>  echo round($price,2);
>  // 12.67, ok
>  echo round($price2,2);
>  // 12.67, ok
> ?>
> 
> Misconfiguration ? Bug ?

It's a direct mapping to the libc function, strfmon [1], and an equivalent C 
script gave the same result so it's not a bug in PHP. Locales can't define 
rounding rules, so it's not related to that.

Googling for strfmon rounding errors doesn't get any useful results, so either 
this is by design or it's never caused anyone a problem.

Solution... pass the number through round before going in to money_format.

-Stuart

-- 
Stuart Dallas
3ft9 Ltd
http://3ft9.com/
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Round with money_format

2011-09-16 Thread Stuart Dallas
Oops...

On 16 Sep 2011, at 16:36, Stuart Dallas wrote:

> On 16 Sep 2011, at 15:58, Cyril Lopez wrote:
> 
>> Can someone help me understand how money_format() rounds numbers ?
>> 
>> > setlocale(LC_ALL, 'fr_FR.UTF-8');
>> $price = 12.665;
>> echo money_format('%i',$price);
>> // 12.66 EUR, 12.67 EUR expected
>> 
>> $price2 = 12.666;
>> echo money_format('%i',$price2);
>> // 12.67 EUR, ok
>> 
>> echo round($price,2);
>> // 12.67, ok
>> echo round($price2,2);
>> // 12.67, ok
>> ?>
>> 
>> Misconfiguration ? Bug ?
> 
> It's a direct mapping to the libc function, strfmon [1], and an equivalent C 
> script gave the same result so it's not a bug in PHP. Locales can't define 
> rounding rules, so it's not related to that.
> 
> Googling for strfmon rounding errors doesn't get any useful results, so 
> either this is by design or it's never caused anyone a problem.
> 
> Solution... pass the number through round before going in to money_format.
> 
> -Stuart

[1] http://lxr.php.net/opengrok/xref/PHP_5_3/ext/standard/string.c#5156

> -- 
> Stuart Dallas
> 3ft9 Ltd
> http://3ft9.com/


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



Re: [PHP] Help on number matching function

2011-09-16 Thread Andre Polykanine

Hello Dare,

  

DW> I need a Function of any category in  either PHP or MySQL RDBMS
DW> customize Function, Class, Methods or anything that could help me
DW> compare a particular set of number and return their matching
DW> result.

consider using array_intersect().


-- 
With best regards from Ukraine,
Andre
Skype: Francophile
My blog: http://oire.org/menelion (mostly in Russian)
Twitter: http://twitter.com/m_elensule
Facebook: http://facebook.com/menelion


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



[PHP] Episode 2 - All The Cool Kids Use Ruby

2011-09-16 Thread Daevid Vincent
http://www.youtube.com/watch?v=5GpOfwbFRcs
 
LOLercopter


RE: [PHP] Episode 2 - All The Cool Kids Use Ruby

2011-09-16 Thread Jen Rasmussen
WOOT! ...you made my day with this :D thanks

Cheers!

-Original Message-
From: Daevid Vincent [mailto:dae...@daevid.com] 
Sent: Friday, September 16, 2011 1:30 PM
To: php-general@lists.php.net
Subject: [PHP] Episode 2 - All The Cool Kids Use Ruby 

http://www.youtube.com/watch?v=5GpOfwbFRcs
 
LOLercopter


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



Re: [PHP] Episode 2 - All The Cool Kids Use Ruby

2011-09-16 Thread Robert Cummings

On 11-09-16 02:30 PM, Daevid Vincent wrote:

http://www.youtube.com/watch?v=5GpOfwbFRcs

LOLercopter


That's just fantastic!

Have a great weekend.

Cheers,
Rob.
--
E-Mail Disclaimer: Information contained in this message and any
attached documents is considered confidential and legally protected.
This message is intended solely for the addressee(s). Disclosure,
copying, and distribution are prohibited unless authorized.

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



[PHP] Re: PHP 5.4.0beta1 released

2011-09-16 Thread Shawn McKenzie
On 09/15/2011 08:50 PM, d...@php.net wrote:

Thanks X4!


-- 
Thanks!
-Shawn
http://www.spidean.com

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



Re: [PHP] Help on number matching function

2011-09-16 Thread Mattias Thorslund
If one or both of your data sets are in MySQL already, there may be no 
need to do the comparison in PHP. Just use IN() or INNER JOIN. Or is 
there some particular reason why neither of these will work in your case?


Cheers,

Mattias

On 09/16/2011 05:36 AM, Dare Williams wrote:

Dear PHP Group,

I need a Function of any category in  either PHP or MySQL RDBMS customize 
Function, Class, Methods or anything that could help me compare a particular 
set of number and return their matching result. e.g If I have a 5 Digits set of 
number  and need to match it with another set of five  digits and return how 
many number are match and the figures that are match.

1.(62,39,47,25,14) - (14,39,62,25,47) - match 5 (all)
2.(55,11,27,62,39) - (66,39,12,13,27) - match 2 (27,39)
3.(20,04,56,17,16) - (16,01,17,04,79) - match 3 (16,17,04)

Any Help will be appreciated.

Thank you.





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



Re: [PHP] XML enabled but not working

2011-09-16 Thread Matthew Pounsett

On 2011/09/16, at 10:27, Richard Quadling wrote:

> On 15 September 2011 21:20, Matthew Pounsett  wrote:
>> Anyone have any thoughts on what to look at?
> 
> php -m
> php --rf xml_parser_create

Thanks.  This seems to reinforce that there's something wrong, but I don't feel 
like I know any more about what's broken. :)

> php -m
[PHP Modules]
Core
date
ereg
libxml
mysqlnd
pcre
Reflection
SPL
standard

[Zend Modules]

> php --rf xml_parser_create
Exception: Function xml_parser_create() does not exist


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



Re: [PHP] XML enabled but not working

2011-09-16 Thread Richard Quadling
On 16 September 2011 23:18, Matthew Pounsett  wrote:
>
> On 2011/09/16, at 10:27, Richard Quadling wrote:
>
>> On 15 September 2011 21:20, Matthew Pounsett  wrote:
>>> Anyone have any thoughts on what to look at?
>>
>> php -m
>> php --rf xml_parser_create
>
> Thanks.  This seems to reinforce that there's something wrong, but I don't 
> feel like I know any more about what's broken. :)
>
>> php -m
> [PHP Modules]
> Core
> date
> ereg
> libxml
> mysqlnd
> pcre
> Reflection
> SPL
> standard
>
> [Zend Modules]
>
>> php --rf xml_parser_create
> Exception: Function xml_parser_create() does not exist
>
>

The xml_parser_create() function is in the XML extension, not in the
libxml extension.

php --re libxml
vs
php -d extension=php_xml.dll --re xml

Assuming php_xml.dll is available (may need to be .so rather than .dll
for non windows).

-- 
Richard Quadling
Twitter : EE : Zend : PHPDoc
@RQuadling : e-e.com/M_248814.html : bit.ly/9O8vFY : bit.ly/lFnVea

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



[PHP] Re: XML enabled but not working

2011-09-16 Thread James Moe
On 09/15/2011 01:20 PM, Matthew Pounsett wrote:
> 
> I seems to behaving issues with php5 on one particular server, and I haven't 
> been able to find the issue.  Basically, php says XML is enabled, but xml 
> functions are missing.
> 
>> php -i | grep "XML support"
> libXML support => active
> 
  Perhaps you need to install libxml[2]?

-- 
James Moe
jmm-list at sohnen-moe dot com

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



Re: [PHP] Episode 2 - All The Cool Kids Use Ruby

2011-09-16 Thread Bastien
That was very funny. A perfect Friday item!

Bastien Koert
905-904-0334

On 2011-09-16, at 2:30 PM, "Daevid Vincent"  wrote:

> http://www.youtube.com/watch?v=5GpOfwbFRcs
> 
> LOLercopter

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