Re: [PHP-DEV] RFC: New math functions: log2, etc

2001-08-07 Thread Jesus M. Castagnetto

Aparently PAN (the newsreader I used) does not make the right stuff for
the MARC archive to add the poster name.

-- Jesus M. Castagnetto ([EMAIL PROTECTED])

In article [EMAIL PROTECTED], Jesus M.
Castagnetto [EMAIL PROTECTED] wrote:

 In article
 [EMAIL PROTECTED],
 Sterling Hughes [EMAIL PROTECTED] wrote:  [snip]
 
  However, IMO the log, exp, sinus, etc. functions should be in the
  core.
 
  Yes, I agree, however, expm1 and log1p don't.
I agree. Do you suggest here to hold these two, until some kind of
advanced-math-extension will be added?
 Perhaps not too many people that use PHP for  biz purposes use them, but
 the few that do use it for some scientific/math stuff will appreciate
 those functions, in particular when dealing with numerical methods
 (derivation, integration, etc.). Of course I am all for putting them in
 a extension, perhaps of GSL (the lib that AFAICT is more complete among
 the Open Sources ones)
 
  Some other thing, the M_*
constants. I always wondered why for example M_2_SQRTPI (2/sqrt(PI))
was in PHP. IMO, there are only one or two essential constants to be in
the core: PI (of course), and (possibly) the EULER-constant. What about
adding PI and, possibly, EULER as constant (without the M_), and
deprecating those M_ constants? Or at least promote them to the
math-extension?
 Yeah, I'd say so...  the reason? IMHO, no one was either paying
 attention to revert them, or wanted to revert someone else's commit
 (common problem ;-)  -Sterling
 Mea culpa, I use those for geometrical/trigonometrical conversions
 (along with some PHP implemented versions of the hyperbolic funcs and
 the like), and they are part of the math.h IIRC and the ISO specs for
 the C library. When we get ready the (future) GSL/math extension
 (matrices, vectors, yes), we could easily move them there (same for
 some functions).  Apropos, how would I go about implementing a new
 variable type, namely complex numbers? AFAICT, we can do the vectors in
 GSL as linear arrays, I got no clue as to how to translate the comple
 number record type into something already defined in PHP/Zend.  (Please
 cc me as I usually read this via the news interface)

-- 
PHP Development Mailing List http://www.php.net/
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP-DEV] Re: PHP Notes

2001-08-06 Thread Jesus M. Castagnetto

In article 01080514382301.00908@linuxbox, Andy [EMAIL PROTECTED] wrote:

 Since I have started maintaining the document notes, I have roughly
 estimated that 1/2-2/3 of the notes have to be deleted because people
 are not following the guidelines.  The page that tells these guidelines
 is setup in paragraph form, which not too many people seem to read.  I
 propose shortening this page and/or putting the guidelines in bulleted
 form.
 Anybody agree/disagree?
 (*Andy*)

That sounds like a good idea. Check also the text for the reject option
of the admin interface. We rehashed the info in the email send when
rejecting an improper note.

What about Rasmus's idea of signing for a particular section or function
group? In this way those will be the main admin duty, and he/she can also
check other sections as time permits.

-- 
PHP Development Mailing List http://www.php.net/
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP-DEV] RFC: New math functions: log2, etc

2001-08-06 Thread Jesus M. Castagnetto

In article [EMAIL PROTECTED],
Sterling Hughes [EMAIL PROTECTED] wrote:

[snip]

  However, IMO the log, exp, sinus, etc. functions should be in the
  core.
 
  Yes, I agree, however, expm1 and log1p don't.
I agree. Do you suggest here to hold these two, until some kind of
advanced-math-extension will be added?

Perhaps not too many people that use PHP for  biz purposes use them, 
but the few that do use it for some scientific/math stuff will appreciate
those functions, in particular when dealing with numerical methods
(derivation, integration, etc.). Of course I am all for putting them in a
extension, perhaps of GSL (the lib that AFAICT is more complete 
among the Open Sources ones)

  Some other thing, the M_*
constants. I always wondered why for example M_2_SQRTPI (2/sqrt(PI)) was
in PHP. IMO, there are only one or two essential constants to be in the
core: PI (of course), and (possibly) the EULER-constant.
What about adding PI and, possibly, EULER as constant (without the M_),
and deprecating those M_ constants? Or at least promote them to the
math-extension?
 Yeah, I'd say so...  the reason? IMHO, no one was either paying
 attention to revert them, or wanted to revert someone else's commit
 (common problem ;-)  -Sterling

Mea culpa, I use those for geometrical/trigonometrical conversions (along
with some PHP implemented versions of the hyperbolic funcs and the like), and
they are part of the math.h IIRC and the ISO specs for the C library.
When we get ready the (future) GSL/math extension (matrices, vectors,
yes), we could easily move them there (same for some functions).

Apropos, how would I go about implementing a new variable type, namely
complex numbers? AFAICT, we can do the vectors in GSL as linear arrays,
I got no clue as to how to translate the comple number record type into
something already defined in PHP/Zend.

(Please cc me as I usually read this via the news interface)

-- 
PHP Development Mailing List http://www.php.net/
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP-DEV] Re: Patch for ext/standard/[basic_functions.c|php_math.h|math.c]

2001-08-02 Thread Jesus M. Castagnetto


--- Stig S. Bakken [EMAIL PROTECTED] wrote:
[...big snip...]
 If we add a log function, does anyone want to
 guess how many scripts
 will break because of it? :-)

Hmm, we have had a natural logarithm function (log)
since back in PHP3, in fact the availability of those
functions is what make me transition from w3-msql
(yeah, I know) to PHP for when I use MiniSQL.

I do not follow the ... many scripts will break bit
...

 Namespaces would have been nice now, import log
 from Math;

Sure, that is what I am dreaming about, something
like:

import Matrix from GSL;

Cheers.

=
--- Jesus M. Castagnetto [EMAIL PROTECTED]

__
Do You Yahoo!?
Make international calls for as low as $.04/minute with Yahoo! Messenger
http://phonecard.yahoo.com/

-- 
PHP Development Mailing List http://www.php.net/
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP-DEV] Re: Patch for ext/standard/[basic_functions.c|php_math.h|math.c]

2001-08-01 Thread Jesus M. Castagnetto


--- Jeroen van Wolffelaar [EMAIL PROTECTED]
wrote:
  I am sending this patch to the php-dev list for
 your
  consideration. Attached are the listing produced
 with
  cvs diff -u, and listed below is a test file to
  check the changes. 
  
  Basically I just added some more math funcs from
 the C
  library (hyperbolics and exponentials). 
 
 Hyporbolic functions are indeed good to be added.
 However,
 I don't think it's really need to add log2, exp10,
 cbrt and so
 forth. It's a bit overkill, and not needed (IMO).

It might be that. Just implemented the functions
taking advantage of their presence in the standard set
of math functions of the C library, so the C people
might be more familiar that the rest I guess.

I was going to add the erf, gamma, etc. function, but
I am not sure if those are of general use (and because
I am just starting to familiarize myself w/ the
Zend/PHP macros/coding style)

[... snip ...]


=
--- Jesus M. Castagnetto [EMAIL PROTECTED]

__
Do You Yahoo!?
Make international calls for as low as $.04/minute with Yahoo! Messenger
http://phonecard.yahoo.com/

-- 
PHP Development Mailing List http://www.php.net/
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP-DEV] Fwd: [PEAR] Help with pear/php module development

2001-07-25 Thread Jesus M. Castagnetto

I think this is more of interest of the php-dev list not of PEAR list
(CC'ing to the php-dev list)


--- PHP [EMAIL PROTECTED] wrote:
 Date: Tue, 24 Jul 2001 16:57:19 -0700
 From: PHP [EMAIL PROTECTED]
 To: [EMAIL PROTECTED]
 Subject: [PEAR] Help with pear/php module development
 
 
 Hello,
  Something seems to have broken in pear that in-turn broke a php module I
 created.
 
  I developed a drop in module for php4 that worked great for PHP-4.0 to
 PHP-4.0.4.  As of 
 PHP-4.0.5 it broke and would no longer build properly.  At link time it is
 failing to link to the proper libraries.
 
 Here's a snippet of the make message.
 
  /bin/sh /root/tclink-3.2.2-php/php/libtool --mode=link gcc  -I.
 -I/root/tclink-3.2.2-php/php/ -I/root/tclink-3.2.2-php/php/main
 -I/root/tclink-3.2.2-php/php -I/usr/local/include/php
 -I/usr/local/include/php/main -I/usr/local/include/php/Zend
 -I/usr/local/include/php/TSRM  -DHAVE_CONFIG_H -g -O2   -o tclink.la
 -avoid-version -module -rpath /root/tclink-3.2.2-php/php/modules  tclink.lo 
 -L/usr/lib -Wl,lcrypto -Wl,lssl
  mkdir .libs
  (cd .  ln -s tclink.lo tclink.o)
  gcc -shared  tclink.lo  -L/usr/lib -lc  -Wl,-soname -Wl,tclink.so -o
 .libs/tclink.so
 
 There -- that last line should have a -lssl -lcrypto -ltclink but it does
 not and ends up not linking to the proper libraries.
 
 My config.m4 file worked fine for all the other versions of PHP so I am
 assuming that something in pear broke.  I found a fix on Usenet that worked
 for 4.0.5 but NOT 4.0.6.  The fix was to change this step in the install 
 
 ./configure --with-tclink=../C --with-ssl=/usr/lib
 
 to this ...
 
 CFLAGS=$CFLAGS -DHAVE_TCLINK=1 -DCOMPILE_DL_TCLINK=1 ./configure
 --with-tclink=../C --with-ssl=/usr/lib
 
 For anyone who wants to look at my package and try to help me find a
 workaround the package can be found here
 
 http://www.trustcommerce.com/tclink-3.2.2-php.tar.gz
 
 Also, here is my config.m4 file.  I have a feeling it can be a LOT simpler
 but just dont understand the tool well enough to know where to go.
 


 
 dnl $Id: config.m4,v 1.1 2001/03/26 23:26:19 adam Exp $
 dnl config.m4 for extension tclink
 dnl don't forget to call PHP_EXTENSION(tclink)
 
 PHP_ARG_WITH(ssl, for TCLink (SSL) support,
 [  --with-ssl[=DIR]Include TCLink (SSL) support. DIR is the OpenSSL
 base
   directory.], no)
 
 if test $PHP_SSL != no; then
   AC_MSG_CHECKING(for TCLink (SSL) libraries)
 
   for i in $PHP_SSL; do
 if test -r $i/libssl.a; then
   TCLINK_SSL_LIB_DIR=$i;
 fi
   done
 
   if test -z $TCLINK_SSL_LIB_DIR; then
 AC_MSG_ERROR(Cannot find SSL library files under $PHP_SSL)
   fi
 
   AC_MSG_RESULT($TCLINK_SSL_LIB_DIR)
 
   AC_ADD_LIBRARY_WITH_PATH(crypto, $TCLINK_SSL_LIB_DIR)
   AC_ADD_LIBRARY_WITH_PATH(ssl, $TCLINK_SSL_LIB_DIR)
 fi
 
 
 PHP_ARG_WITH(tclink, for TCLink support,
 [  --with-tclink[=DIR] Include TCLink support. DIR is the TCLink base
   directory.], no)
 
 if test $PHP_TCLINK != no; then
 
   if test $PHP_SSL = no; then
 AC_MSG_ERROR(Cannot enable support for TCLink without OpenSSL libraries)
   fi
 
   AC_MSG_CHECKING(for TCLink library)
 
   for i in $PHP_TCLINK; do
 if test -r $i/tclink.h; then
   TCLINK_INC_DIR=$i
 fi
 if test -r $i/libtclink.a; then
   TCLINK_LIB_DIR=$i
 fi
 if test -r $i/libtclink.so; then
   TCLINK_LIB_DIR=$i
 fi
   done
 
   if test -z $TCLINK_INC_DIR; then
 AC_MSG_ERROR(Cannot find header files under $PHP_TCLINK)
   fi
 
   if test -z $TCLINK_LIB_DIR; then
 AC_MSG_ERROR(Cannot find library files under $PHP_TCLINK)
   fi
 
   AC_MSG_RESULT($TCLINK_LIB_DIR)
 
   AC_ADD_LIBRARY_WITH_PATH(tclink, $TCLINK_LIB_DIR, TCLINK_SHARED_LIBADD)
   if test $ext_shared = yes; then
 TCLINK_SHARED_LIBADD=$TCLINK_SHARED_LIBADD -L$TCLINK_SSL_LIB_DIR
 -Wl,lcrypto -Wl,lssl
   fi
 
   AC_ADD_INCLUDE($TCLINK_INC_DIR)
 
   AC_DEFINE(HAVE_TCLINK, 1, [Whether you have TCLink])
   PHP_EXTENSION(tclink, $ext_shared)
   PHP_SUBST(TCLINK_SHARED_LIBADD)
 fi
 


 
 
 
 
 -- 
 PEAR General Mailing List (http://pear.php.net/)
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 To contact the list administrators, e-mail: [EMAIL PROTECTED]
 

=
--- Jesus M. Castagnetto ([EMAIL PROTECTED])

__
Do You Yahoo!?
Make international calls for as low as $.04/minute with Yahoo! Messenger
http://phonecard.yahoo.com/

-- 
PHP Development Mailing List http://www.php.net/
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP-DEV] Re: [PHP-DOC] Re: [PHP-DEV] List messages are being delayed?

2001-06-21 Thread Jesus M. Castagnetto

Rasmus and all,

I was talking with some of the people in the local LUG
(www.kernel-panic.org), and the SDPHP, and most where
enhtusiastic about trying to get some host for the
CVS, lists, etc.

Someone commented last week in #php that you were
using your home connection because there was no
hosting for that anymore. What would be needed? in
particular what would be the bandwith requirements?

Some of the people in the KPLUG make a living hosting,
so it is feasible to get something setup.


--- Rasmus Lerdorf [EMAIL PROTECTED] wrote:
  For some reason, it seems that messages sent to
 the lists aren't being
  delivered for over 5 hours or more.  I only just
 got a message that I sent
  today at 11:30AM.  Although, they do show up on
 the news server pretty
  quickly.
 
  Is anyone else experiencing this?
 
 Sure, the lists will be somewhat slow.  The
 bandwidth needed to deliver
 all these is right on the limit of what I can
 provide.  At peak times the
 box falls behind, but then it catches up as things
 slow down.  And
 sometimes I need the bandwidth and I will just
 unplug the list server for
 a while as my connection is pretty much useless when
 the box is plugged
 in.
 
 This is a temporary situation just to get the lists
 working again.  An
 alternative will need to be found quickly.
 
 -Rasmus
 


=
--- Jesus M. Castagnetto [EMAIL PROTECTED]

__
Do You Yahoo!?
Get personalized email addresses from Yahoo! Mail
http://personal.mail.yahoo.com/

-- 
PHP Development Mailing List http://www.php.net/
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP-DEV] Possible bug in Object definition -- Fwd: [PHP-NOTES] note 12009 added to language.oop.php

2001-03-18 Thread Jesus M. Castagnetto

This is a strange behavior. If the original class have
no predefined variables, then if the object's
constructor does no assignment of its own, the
resulting object compares to null, e.g.

class foo {
var $bar;
function foo() {
// do nothing
}
}
$o = new foo();
if ($o == null) echo "boom!";
if (empty($o)) echo " zap!";


Outputs "boom! zap!", even when the object was
created. Are we assuming than an object w/ no defined
member vars is a null object? Not sure that is the
expected behavior, but I might be wrong.

Adding a predefined var in the class definition or
setting one in the constructor, "fixes" the problem.

Tested it w/ PHP 4.0.4pl1 and latest PHP from CVS
(both compiled as stand alone executables)

--- [EMAIL PROTECTED] wrote:
 Date: 18 Mar 2001 05:33:38 -
 To: [EMAIL PROTECTED]
 From: [EMAIL PROTECTED]
 Subject: [PHP-NOTES] note 12009 added to
 language.oop.php
 
 I wondered why the "new" assignments in these
 examples were never tested for success --- ie. 
 if(!($var = new Cart())) echo "failure";
 
 Now I know (at least for PHP4.0.4pl1).
 
 The test ALWAYS fails unless the constructor of the
 class does a local member variable assignment.
 
 This I don't like.  Could someone please explain to
 me why this is a "good thing"?
 
  http://www.php.net/manual/en/language.oop.php 
 
 
 -- 
 PHP Notes Mailing List (http://www.php.net/)
 To unsubscribe, e-mail:
 [EMAIL PROTECTED]
 For additional commands, e-mail:
 [EMAIL PROTECTED]
 To contact the list administrators, e-mail:
 [EMAIL PROTECTED]
 


=
--- Jesus M. Castagnetto [EMAIL PROTECTED]

__
Do You Yahoo!?
Get email at your own domain with Yahoo! Mail. 
http://personal.mail.yahoo.com/

-- 
PHP Development Mailing List http://www.php.net/
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP-DEV] Re: [PHP-PEAR] PEAR issue #2 (pear-dev) vote

2001-02-22 Thread Jesus M. Castagnetto

[ ] do not change anything
 
( ) pear-users and pear-dev
(X) pear-general and pear-dev

* Although I think the last 2 are practically equivalent

=
--- Jesus M. Castagnetto ([EMAIL PROTECTED])

__
Do You Yahoo!?
Yahoo! Auctions - Buy the things you want at great prices! http://auctions.yahoo.com/

-- 
PHP Development Mailing List http://www.php.net/
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP-DEV] BUG in sscanf - was -Re: [PHP-NOTES] note 11314 added to sscanf

2001-02-15 Thread Jesus M. Castagnetto

Lo mejor es que submitas este problema en
bugs.php.net, de otro modo los del equipo del
PHP-DEVEL no veran este problema. Estoy haciendo un
CC, pero submitelo de todas maneras.

[PHP-DEV team:]
This is a repeatable bug, tried the code included in
the msg below w/ the results mentioned. I am using PHP
4.0.4pl1

--- [EMAIL PROTECTED] wrote:
 Hay un error en la funcion sscanf ya que no realiza
 la lectura de datos segun el formato especificado.
 Por ejemplo, consideremos el siguiente codigo:
 
 ?php
   // este script es una prueba del scanf
   $str="hola;esto;es;una;prueba";
   $a="";
   $b="";
   $c="";
   $d="";
   $e="";
   sscanf($str,"%s;%s;%s;%s;%s",$a,$b,$c,$d,$e);
   echo $a.$b.$c.$d.$e;
 ?
 
 La salida seria la siguiente:
 
 hola;esto;es;una;prueba
 
 Por el contrario si usamos el siguiente
 formato:
 
 ?php
   // este script es una prueba del scanf
   $str="hola ; esto ; es ; una ; prueba";
   $a="";
   $b="";
   $c="";
   $d="";
   $e="";
   sscanf($str,"%s ; %s ; %s ; %s ;
 %s",$a,$b,$c,$d,$e);
   echo $a.$b.$c.$d.$e;
 ?
 
 la salida es correcta:
 
 holaestoesunaprueba
 
 Se ve que la funcion sólo respeta
 el formato si las zonas donde se
 indica que comienza una variable 
 (en el codigo %(tipo_de_variable))
 esta aislada, es decir, separada
 con espacios del resto de los
 caracteres del formato.
 
 Saludos desde cordoba
 
  http://www.php.net/manual/en/function.sscanf.php 
 
 
 -- 
 PHP Notes Mailing List (http://www.php.net/)
 To unsubscribe, e-mail:
 [EMAIL PROTECTED]
 For additional commands, e-mail:
 [EMAIL PROTECTED]
 To contact the list administrators, e-mail:
 [EMAIL PROTECTED]
 


=
--- Jesus M. Castagnetto [EMAIL PROTECTED]

__
Do You Yahoo!?
Get personalized email addresses from Yahoo! Mail - only $35 
a year!  http://personal.mail.yahoo.com/

-- 
PHP Development Mailing List http://www.php.net/
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]